if exists (select 1 from sysobjects where name = 'set_dienstschema' and type = 'P')
begin
   drop procedure set_dienstschema
   print 'Procedure: set_dienstschema deleted ...'
end
go
create procedure set_dienstschema(
  @schemaid      int = 1,
  @abteilungid   int = 1,
  @dienstid      int = 1,
  @einsatzprotag int = 1,
  @gerechnet     int = 1
)
as
begin

   set nocount on

   insert into dienstschema (schemaid,abteilungid,dienstid,einsatzprotag,gerechnet) values (@schemaid, @abteilungid, @dienstid, @einsatzprotag, @gerechnet)

end
go
print 'Procedure: set_dienstschema done ...'
go
grant exec on set_dienstschema to prsadmins with grant option
go
grant exec on set_dienstschema to prsusers
go

